<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style>
        :root {
            --primary: #6a5acd;
            --text: #333;
            --bg: #f8f9fa;
            --border: #ddd;
            --error: #e53e3e;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 2rem;
            background: var(--bg);
            color: var(--text);
        }
        
        h1 {
            color: var(--primary);
            font-size: 1.8rem;
            text-align: center;
            margin-bottom: 2rem;
        }
        
        form {
            background: white;
            max-width: 400px;
            margin: 0 auto;
            padding: 1.5rem;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }
        
        input {
            width: 100%;
            padding: 0.75rem;
            margin-bottom: 1rem;
            border: 1px solid var(--border);
            border-radius: 4px;
            box-sizing: border-box;
        }
        
        input[type="submit"] {
            background: var(--primary);
            color: white;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        input[type="submit"]:hover {
            background: #5a4bad;
        }
        
        .error {
            color: var(--error);
            margin-top: 1rem;
            text-align: center;
        }
    </style>
</head>
<body>
    <h1>登录</h1>
    <form action="login" method="post">
        <label for="account">账号:</label>
        <input type="text" id="account" name="account" required>
        
        <label for="password">密码:</label>
        <input type="password" id="password" name="password" required>
        
        <input type="submit" value="登录">
    </form>
    <% if (request.getAttribute("error") != null) { %>
        <p class="error"><%= request.getAttribute("error") %></p>
    <% } %>
</body>
</html>